package versionControl.aspectj.test;

import versionControl.aspectj.library.*;

public aspect RollbackObjectAspect extends Rollback {

	// Rollback the instance to the previous version in case 
	// UnSupportedField exception was thrown
		
	private void ObjectVersionControlChecker.rollback()
	{
	}

	public pointcut rollback(Versioned obj): target(obj) && call(void rollback());
	 //public pointcut rollback(Versioned obj): handler (UnSupportedField+) && within(Versioned) && this(obj);
	
	 after(ObjectVersionControlChecker obj) throwing(UnSupportedField e): within(ObjectVersionControlChecker)	&& this(obj) 
	 {
		 obj.rollback();
	 }
		
}